<template>
	<view>
		<view class="tit">
			<image class="imga" src="../../static/images/xiaoyou1.png" ></image>我的校友卡
		</view>
		<view class="card">
			<image class="img" src="../../static/images/card.png" ></image>
		</view>
		<view class="content" v-for="(alumnu,i) in alumnus">
			<!-- <view class="msg">
				<view >{{alumnu.name}}</view>
				<view v-if="alumnu.gender==0">男</view>
				<view v-else="alumnu.gender==1">女</view>
				<view class="h1">{{alumnu.depart}}</view>
			</view> -->
			<view>
				<image class="img1" :src="getHeadImg(alumnu.headImg)" ></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				alumnus:[], /* 校友*/
				id:''
			}
		},
		onLoad() {
			var that = this;
			uni.request({
				 url:getApp().globalData.URL+'associationUserInfo/userid',
				 data:{
					 userId:2
				 },
				 header: {
				     'content-type': 'application/json;charset=UTF-8' // 默认值
				   },
				success:res =>{
					console.log("后台传来的",res.data)
					that.alumnus = res.data;
					}
			})
		},
		methods: {
			getHeadImg(head_img){
				if(head_img == null || head_img == ''){
					return getApp().globalData.Link+'upload/图片/gzmu_logo-20200809115334510.jpg';
				}else{
					return getApp().globalData.Link+'upload/图片/'+head_img;
				}
				
			}
		}
	}
</script>

<style>
	.h1{
		font-size: 21rpx;
	}
	.msg view{
		margin-bottom: 15rpx;
	}
	.msg{
		display: block;
		position: absolute;
		left: 200rpx;
		top: 330rpx;
		color: white;
	}
	.content{
		
	}
	.card{
		display: flex;
		width: 100%rpx;
		height: 400rpx;
	}
	.img {
		margin-top: 20rpx;
		margin: 15rpx 10rpx;
		width: 735.8743169399rpx;
		height: 460rpx;
	}

	.tit {
		color: #007AFF;
		margin: 15rpx 10rpx;
		font-size: 45rpx;
		border-bottom: 1px solid #007AFF;
	}

	.imga {
		margin-top: 20rpx;
		width: 80rpx; 
		height: 80rpx;
	}

	.img1 {
		display: block;
		border-radius: 50%;
		position: absolute;
		left: 489rpx;
		top: 289rpx;
		width: 228rpx;
		height: 228rpx;

		/* top: -322rpx; */
	}
</style>
